/*
 *  Copyright 2010 UPF Telecos 4th group G.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package edu.upf.database;

import java.util.List;

/**
 * Models the result of a database action
 * @author netjois
 */
public interface DBActionResult {

    /**
     * Returns true if the action performed was successful
     * @return
     */
    boolean isOk();

    /**
     * Gets the error message if any
     * @return
     */
    String getErrorMsg();

    /**
     * Gets the exception if any
     * @return
     */
    Throwable getException();

    /**
     * Gets the result list of the action
     * @return
     */
    List getResult();

    /**
     * Sets the error message of the action
     * @param aErrorMsg
     */
    void setErrorMsg(String aErrorMsg);

    /**
     * Sets the exception related to the action
     * @param aException
     */
    void setException(Throwable aException);

    /**
     * Sets the result of the action
     * @param aResult
     */
    void setResult(List aResult);
}
